#ifndef CLIENT_H
#define CLIENT_H

#include <QWidget>
#include <QTcpSocket>
#include <iostream>
#include "model.h"
#include <QtMath>
#include "qcustomplot.h"

namespace Ui {
class Client;
};



class Client : public QWidget
{
    Q_OBJECT

public:
    explicit Client(QWidget *parent = nullptr);
    ~Client();





    //Model model;


private slots:
    void on_ButtonConnect_clicked();

    void on_ButtonSend_clicked();

    void on_pushButton_3_clicked();

    void readMessage();

    void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;

    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_4_clicked();

    void on_ButtonSend_2_clicked();

    void on_pushButton_5_clicked();

    void Plot();

    void realtimeDataSlot();

    void setupRealtimeDataDemo();

    void on_pushButton_6_clicked();

private:
    Ui::Client *ui;

    QTcpSocket *tcpSocket;


    int MAX_VIEW = 8;
    double position = 0;
    double theta = M_PI;
    int car_size[2] = {80,15};
    int stick_length = 60;

    float x_time=0.001;
    double tpn;


};

#endif // CLIENT_H
